package com.kadron.jobs;

import java.util.TimerTask;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

import com.kadron.dao.KCommonDAO;
import com.kadron.entity.Currency;

@AutoCreate
@Name(KDBConnectionJob.K_NAME)
@Scope(ScopeType.EVENT)
public class KDBConnectionJob extends TimerTask {
	
	public static final String K_NAME = "KDBConnectionJob";
	public static final String INFO_MESASGE = "RUN job"+K_NAME;
	
	private static final Log log = LogFactory.getLog(KDBConnectionJob.class);

	@In
	private KCommonDAO commonDAO;
	
	@Override
	public void run() {
		if (log.isInfoEnabled()) {
			log.info(INFO_MESASGE);
		}
		commonDAO.getAll(Currency.class);
	}

	
	
}
